package cn.zhl.设计模式.原型;

import cn.zhl.设计模式.原型.stream.CloneStreamDemo;

/**
 * @program: demos
 * @description:
 * @author: 刘振华
 * @create: 2021-03-07 15:13
 **/
public class TestMain {
	public static void main(String[] args) {
		CloneStreamDemo source = new CloneStreamDemo();
		source.setAge(10);
		source.setName("tom");
		DeepObj deepObj = new DeepObj();
		deepObj.setAge(20);
		deepObj.setName("deep");
		source.setDeepObj(deepObj);

		CloneStreamDemo target = source.myClone();
		System.out.println(source.getDeepObj().hashCode());
		System.out.println(target.getDeepObj().hashCode());
		System.out.println(source.getName()+","+source.getDeepObj().getName());
		System.out.println(target.getName()+","+target.getDeepObj().getName());
	}
}
